using Admin.NET.Core;
using MOKA.TPM.Entity;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （设备类型的点检项目）
/// </summary>
public class CheckupItemTPMCategoryOutput : CheckupItemTPMCategory
{
    /// <summary>
    /// 设备类型 （字典名称）
    /// </summary>
    public string? TPMCategoryName { get; set; }

    /// <summary>
    /// TPM设备分组 （字典名称）
    /// </summary>
    public string? TPMDeviceGroupName { get; set; }

    /// <summary>
    /// 点检周期 （字典名称）
    /// </summary>
    public string? CheckupCycleName { get; set; }

    /// <summary>
    /// 创建用户 （字典或人员名称）
    /// </summary>
    public string? CreateUserName { get; set; }

    /// <summary>
    /// 更新用户 （字典或人员名称）
    /// </summary>
    public string? UpdateUserName { get; set; }

    /// <summary>
    /// 关联对象等
    /// </summary>
    //public string? WePartyLevelName { get; set; }
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class CheckupItemTPMCategoryInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid? Id { get; set; }

    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid? CheckupCycle { get; set; }  //唯一索引

    /// <summary>
    /// 点检项目名称
    /// </summary>
    public string? ItemName { get; set; }  //唯一索引

    /// <summary>
    /// 设备类型
    /// </summary>
    public Guid? TPMCategoryId { get; set; }  //唯一索引
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetCheckupItemTPMCategoryInput : BaseOrderInput
{
    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid? CheckupCycle { get; set; }  //唯一索引

    /// <summary>
    /// 点检项目名称
    /// </summary>
    public string? ItemName { get; set; }  //唯一索引

    /// <summary>
    /// 设备类型
    /// </summary>
    public Guid? TPMCategoryId { get; set; }  //唯一索引
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PageCheckupItemTPMCategoryInput : BasePageInput
{
    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid? CheckupCycle { get; set; }  //唯一索引

    /// <summary>
    /// 点检项目名称
    /// </summary>
    public string? ItemName { get; set; }  //唯一索引

    /// <summary>
    /// 设备类型
    /// </summary>
    public Guid? TPMCategoryId { get; set; }  //唯一索引
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddCheckupItemTPMCategoryInput
{
    /// <summary>
    /// 设备类型
    /// </summary>
    public Guid TPMCategoryId { get; set; }

    /// <summary>
    /// TPM设备分组
    /// </summary>
    public Guid TPMDeviceGroupId { get; set; }

    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid CheckupCycle { get; set; }

    /// <summary>
    /// 步骤序号
    /// </summary>
    public int ItemOrder { get; set; }

    /// <summary>
    /// 点检项目名称
    /// </summary>
    [Required, MaxLength(100)]
    public string ItemName { get; set; } = string.Empty;

    /// <summary>
    /// 点检对象
    /// </summary>
    [Required, MaxLength(200)]
    public string ItemObjects { get; set; } = string.Empty;

    /// <summary>
    /// 点检内容
    /// </summary>
    [Required, MaxLength(2000)]
    public string Content { get; set; } = string.Empty;

    /// <summary>
    /// 检查方法
    /// </summary>
    [Required, MaxLength(200)]
    public string Method { get; set; } = string.Empty;

    /// <summary>
    /// 合格标准
    /// </summary>
    [Required, MaxLength(500)]
    public string EligibilityCriteria { get; set; } = string.Empty;

    /// <summary>
    /// 是否记录参数值
    /// </summary>
    public bool? IsParamValue { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// 创建用户
    /// </summary>
    [Required, MaxLength(20)]
    public string CreateUser { get; set; } = string.Empty;

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 更新用户
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 子表：点检记录详情
    /// </summary>
    public List<CheckupDetail> CheckupDetails { get; set; }//一对多
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdateCheckupItemTPMCategoryInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 设备类型
    /// </summary>
    public Guid TPMCategoryId { get; set; }

    /// <summary>
    /// TPM设备分组
    /// </summary>
    public Guid TPMDeviceGroupId { get; set; }

    /// <summary>
    /// 点检周期
    /// </summary>
    public Guid CheckupCycle { get; set; }

    /// <summary>
    /// 步骤序号
    /// </summary>
    public int ItemOrder { get; set; }

    /// <summary>
    /// 点检项目名称
    /// </summary>
    [MaxLength(100)]
    public string ItemName { get; set; }

    /// <summary>
    /// 点检对象
    /// </summary>
    [MaxLength(200)]
    public string ItemObjects { get; set; }

    /// <summary>
    /// 点检内容
    /// </summary>
    [MaxLength(2000)]
    public string Content { get; set; }

    /// <summary>
    /// 检查方法
    /// </summary>
    [MaxLength(200)]
    public string Method { get; set; }

    /// <summary>
    /// 合格标准
    /// </summary>
    [MaxLength(500)]
    public string EligibilityCriteria { get; set; }

    /// <summary>
    /// 是否记录参数值
    /// </summary>
    public bool? IsParamValue { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// 创建用户
    /// </summary>
    [MaxLength(20)]
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 更新用户
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 子表：点检记录详情
    /// </summary>
    public List<CheckupDetail> CheckupDetails { get; set; }//一对多
}

/// <summary>
/// 删除参数
/// </summary>
public class DeleteCheckupItemTPMCategoryInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomeCheckupItemTPMCategoryInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 点检周期
    /// </summary>
    public string? CheckupCycle { get; set; }  //唯一索引

    /// <summary>
    /// 点检项目名称
    /// </summary>
    public string? ItemName { get; set; }  //唯一索引

    /// <summary>
    /// 设备类型
    /// </summary>
    public string? TPMCategoryId { get; set; }  //唯一索引
}